<div class="text-center py-10">
  <h1 class="title-decorator inline-block text-left">
    <%= t("decidim.verifications.authorizations.new.authorize_with", authorizer: t("#{handler.handler_name}.name", scope: "decidim.authorization_handlers")) %>
  </h1>
</div>

<%= authorization_form_for(handler, url: authorizations_path(redirect_url:)) do |form| %>
  <% if lookup_context.exists?(handler.to_partial_path, [], true) %>
        <%= render partial: handler.to_partial_path, locals: { handler:, form: } %>
  <% else %>
    <div class="form__wrapper">
      <%= form.all_fields %>
    </div>
  <% end %>

  <% if current_user.ephemeral? && !current_user.tos_accepted? %>
    <%= render partial: "tos_acceptance_field", locals: { form: } %>
  <% end %>

  <div class="form__wrapper-block flex-col-reverse md:flex-row justify-between">
    <% if onboarding_manager.available_authorization_selection_page? %>
      <%= link_to authorizations_back_path(current_user, redirect_url:), class: "button button__sm md:button__lg button__text-secondary" do %>
        <%= icon "arrow-left-line", class: "fill-current" %>
        <span><%= t("decidim.wizard_step_form.wizard_aside.back") %></span>
      <% end %>
    <% end %>
    <button type="submit" class="button button__sm md:button__lg button__secondary">
      <span><%= t("decidim.verifications.authorizations.new.authorize") %></span>
      <%= icon "arrow-right-line", class: "fill-current" %>
    </button>
  </div>

  <% unless onboarding_manager.ephemeral? %>
    <p class="prose prose-a:text-secondary">
      <%= t("decidim.verifications.authorizations.skip_verification", link: link_to(t("decidim.verifications.authorizations.start_exploring"), decidim.root_path).html_safe).html_safe %>.
    </p>
  <% end %>
<% end %>
